<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<meta name="applicable-device" content="pc" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<meta http-equiv="Cache-Control" content="no-transform" />
<title>${informationEntity.title }</title>
<meta name="keywords" content="${informationEntity.abstractContent }" />
<meta name="description"
	content="${informationEntity.abstractContent } " />
<link href="<%=path %>/css/common1.css" rel="stylesheet" type="text/css" />
<link href="<%=path %>/css/style.css" rel="stylesheet" type="text/css" />

<script type="text/javascript" src="<%=path %>/js/jquery-1.12.4.min.js"></script>
<script src="<%=path %>/js/global.js" type="text/javascript"></script>
<link href="<%=path %>/bootstrap-3.3.5-dist/css/bootstrap.css"
	rel="stylesheet" type="text/css" />
<script src="<%=path %>/bootstrap-3.3.5-dist/js/bootstrap.js"
	type="text/javascript"></script>
<script type="text/javascript" src="<%=path%>/js/jquery-form.js"></script>
<!--  uediter begin -->
<script type="text/javascript" charset="utf-8"
	src="<%=path%>/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8"
	src="<%=path%>/ueditor/ueditor.all.min.js"></script>
<!--建议手动加在语言，避免在ie下有时因为加载语言失败导致编辑器加载失败-->
<!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型，比如你在配置项目里配置的是英文，这里加载的中文，那最后就是中文-->
<script type="text/javascript" charset="utf-8"
	src="<%=path%>/ueditor/lang/zh-cn/zh-cn.js"></script>
<style>
.container {
    width: 100%;
}
</style>
<script type="text/javascript">
	
	$(function(){

		var ue = UE.getEditor('informationContent');
		
		$('#blog_submit').on('click',function(){
			var url = "<%=path %>/adminstrotor/saveInformation";
			var action = $('#information_form').serialize();
			var result = ajaxWithServer(url,action);
			
			if(result.result){
				if(result.data.addResult == "SUCCESS"){
					window.location.href="<%=path %>/adminstrotor/adminstrotorHome?currentData=2";
				}else{
					alert(result.data.errorMsg);
				}
			}else{
				alert("你没有登陆，或者您没有权限操作");
			}
			
		});
	});
	

</script>
</head>

<body>
	<!--头部-->
	<jsp:include page="../include/head.jsp">
		<jsp:param value="content" name="head" />
	</jsp:include>

	<!--导航-->
	<jsp:include page="../include/nav.jsp">
		<jsp:param value="content" name="nav" />
	</jsp:include>

	<div class="h10"></div>
	<div class="h10"></div>

	<!--美食推荐-->
	<div id="tuijian" class="all_food_box">
		<!--  content -->
	<div id="container" class="container bs-docs-container main_content">
	
		<div class="row">
			<div class="col-md-12" role="main">
				<form id="information_form"   method="post">
					<div class="form-group">
						<label for="blog_title">资讯标题</label> <input 
							class="form-control" id="title" name="title"
							placeholder="资讯标题" required >
					</div>
					<div class="form-group">
						<label for="blogAbstract">摘要</label>
					<textarea class="form-control" style="resize:none;" rows="4"
							id="abstractContent" name="abstractContent" 
							placeholder="简要说明资讯的主要内容" required></textarea>
					</div>

					<div class="form-group">
						<label>资讯正文</label>
						<script id="informationContent" type="text/plain" name="content" style="width:100%;height:500px;">
							
						</script>
					</div>
					
					<div class="form-group">
					<button class="btn btn-info" type="button" id="blog_submit">发&nbsp;&nbsp;&nbsp;布</button>
					</div>
				</form>
			</div>
		</div>
	</div>
	
	</div>
</body>
</html>
